<%-- 
    Document   : control
    Created on : 07-mar-2014, 12:45:55
    Author     : PC
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" import="consultas.funciones"%>
<jsp:useBean id="reg" class="consultas.funciones" scope="session"/>

<!DOCTYPE html>

<%
    String url="index.jsp";
    
    if(request.getParameter("logear")!=null){
        if(request.getParameter("logear").equals("ENVIAR")){
            if(reg.comprobarUsuario(request.getParameter("username"), request.getParameter("password"))==1){
                url="bienvenido.jsp";
            }else {
                url="registro.jsp";
                }
        }
    }
    
    if(request.getParameter("action")!=null){
        if(request.getParameter("action").equals("registrarse")){
            url="registro.jsp";
        }else{
            url="index.jsp";
        }
    }
    %>
    
    <jsp:forward page = "<%=url%>"/>